#! /usr/bin/python
# -*- coding:UTF-8 -*-
#pip install python-redmine
# https://github.com/maxtepkeev/python-redmine

from redminelib import Redmine
redmine = Redmine('http://1.12.236.41:8111/',username='11112222',password='11112222',requests={'timeout': 5 })
issues = redmine.issue.filter(project_id='xuqiu',status_id='open',offset=0,limit=100)

# 遍历bug单
for issue in issues:
    #获取当前BUG编号
    print(issue.id)
    #获取bug单标题
    print(issue.subject)
    # #获取bug单的提单人
    # print issue.author
    # #获取issue创建时间
    # print issue.created_on
    # #获取更新时间
    # print issue.updated_on
	# #遍历追加评论（BUG流转过程）
    # myissue=redmine.issue.get(issue.id, include=['children', 'journals', 'watchers'])
    # for journal in myissue.journals:
	# 	#获取评论人
    #     print journal.user.name
	# 	#获取评论时间
    #     print journal.created_on